<div class="page">
	<div class="page-head">
		<h1 class="font-thin h4">编辑客户单位</h1>
	</div>
	<div class="client-tab">
		<span ui-sref="app.client.client_editNew">基本信息</span>
		<span ui-sref="app.client.customerrepresentative_manageNew">客户代表</span>
		<span ui-sref="app.client.goodstype_manageNew">货物分类</span>
	<span ui-sref="app.client.goods_manageNew">货物</span>
		<span ui-sref="app.client.settleManagentNew">结算方</span>
		<span ui-sref="app.client.lineprice_manageNew">线路报价</span>
		<span ui-sref="app.client.projectManagentNew">工程</span>
		<span class="client-tab-cur">客户资料</span>
		<span ui-sref="app.client.returnPeriodNew">对账回款周期</span>
	</div>
	<div class="page-body">
		<form name="step8" id="clientInfoForm" class="form-validation" novalidate ng-controller="clientInfoManagentControllerNew" >
			 <!--form-horizontal-->
			<div class="list-body">
				<div class="client-company">						
                    <label class="control-label pull-left client-companyLabel">客户单位：</label>
                    <div class="col-md-2 form-group">
                        <label class="control-label pull-left client-companyDetail">{{clientName}}</label>
                    </div>
				</div>
				<div class="list-query">
					<div class="query-terms" ng-if="queryTermsFilterList[0].visible">
						<label class="control-label pull-left">资料名称：</label>
						<input id="clientInfo_name" type="text" class="form-control input-sm query-term" ng-model="queryTerms.name" name="name" placeholder="请输入资料名称">
					</div>

					<div class="query-terms" ng-if="queryTermsFilterList[1].visible">
						<label class="control-label pull-left">资料类别:</label>
						<select id="clientInfo_clientInfoType" class="form-control input-sm query-term tms-select" ng-model="queryTerms.type" name="clientInfoType" ng-options="x.value as x.text for x in typeDropDown">
							<option value="">全部</option>
						</select>
					</div>

					<div class="query-terms" ng-if="queryTermsFilterList[2].visible">
						<label class="control-label pull-left">档案级别:</label>
						<select id="clientInfo_clientInfoLevel" class="form-control input-sm query-term tms-select" ng-model="queryTerms.level" name="level" ng-options="x.value as x.text for x in levelDropDown">
							<option value="">全部</option>
						</select>
					</div>

					<div class="query-terms">   
                        <label class="control-label pull-left"></label>   
						<button id="clientInfo_query" ng-click="queryFunc()" class="btn tms-btn tms-btn-search" ng-class="{'disabled':querying}" ng-disabled="querying">
							<i class="fa fa-search" ng-show="!querying"></i>
							<i class="fa fa-spinner no-bordr" ng-show="querying" ng-class="{'fa-spin':querying}"></i>
							<span ng-show="!querying">查询</span>
							<span ng-show="querying">查询中...</span>
						</button>
					</div>
				</div>
			

			<div class="list-btn-area">
				<!--btn m-b-xs btn-sm btn-addon -->
				<button id="clientInfo_add" data-toggle="modal" data-target="#clientinfo" class="btn tms-btn tms-btn-add" ng-click="addClientInfo()"><span>添加</span></button>
				<div class="list-filter-container">
					<tms-list-filter 
						tab-head-filter="tabHeadFilter(item)"
						query-terms-filter-list="queryTermsFilterList"
						tab-head-filter-list="tabHeadFilterList"
					></tms-list-filter>
				</div>
			</div>

			<div class="list-table">
				<div class="table-responsive">
					<div ui-grid="gridOptions" ui-grid-pagination ui-grid-auto-resize ui-grid-resize-columns style=" height:{{heightA}}px;overflow:hidden; min-width:1650px;">
						<div class="watermark" ng-if="!gridOptions.data.length">暂无数据</div>
					</div>
				</div>
			</div>
			
		</div>


				<!-- Modal -->
				<div class="modal fade bs-example-modal-lg" id="clientinfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
					<div class="modal-dialog modal-lg">
						<div class="modal-content">
							<div class="modal-header client-modalHeader">
								<button id="clientInfo_model" type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
								<h4 class="modal-title" id="myModalLabel">{{title}}</h4>
							</div>
							<div class="modal-body">

								<table class=" table-bordered client-table">
									<tr>
										<td class="client-td-left"><span class="text-danger">*</span>资料名称：</td>
										<td class="client-td-right">
											<input id="clientInfo_nameBox" type="text" name="nameBox" class="form-control input-sm ipt-3" ng-model="detail.name" required placeholder="请填写资料名称">
										</td>
									</tr>
									<tr>
										<td class="client-td-left"><span class="text-danger">*</span>资料类别：</td>
										<td class="client-td-right clientInfo-select">
											<select id="clientInfo_type" class="form-control input-sm ipt-2 tms-select" ng-change="handleInfoTypeChange()" name="infoTypeBox" ng-model="detail.type" ng-options="x.value as x.text for x in typeDropDown" required>
												<option value="">请选择</option>
											</select>
										</td>
									</tr>
									<tr>
										<td class="client-td-left"><span class="text-danger">*</span>档案级别：</td>
										<td class="client-td-right clientInfo-select">
											<select id="clientInfo_level" class="form-control input-sm ipt-2 tms-select" name="infoLevelBox" ng-model="detail.level" ng-options="x.value as x.text for x in levelDropDown" required>
												<option value="">请选择</option>
											</select>									
										</td>
									</tr>
									<tr>
										<td class="client-td-left"><span class="text-danger">*</span>资料内容：</td>
										<td class="client-td-right">
											<div class="btn-toolbar m-b-sm btn-editor" data-role="editor-toolbar" data-target="#editor">
												<!--<div class="btn-group dropdown" dropdown>
													<a class="btn btn-default" dropdown-toggle data-toggle="dropdown"  tooltip="Font"><i class="fa fa-font"></i><b class="caret"></b></a>
													<ul class="dropdown-menu">
														<li><a href data-edit="fontName Serif" style="font-family:'Serif'">Serif</a></li>
														<li><a href data-edit="fontName Sans" style="font-family:'Sans'">Sans</a></li>
														<li><a href data-edit="fontName Arial" style="font-family:'Arial'">Arial</a></li>
													</ul>
												</div>-->
												<div class="btn-group dropdown" dropdown>
													<a class="btn btn-default" dropdown-toggle data-toggle="dropdown" tooltip="字体大小"><i class="fa fa-text-height"></i>&nbsp;<b class="caret"></b></a>
													<ul class="dropdown-menu">
														<li><a href data-edit="fontSize 5" style="font-size:24px">大</a></li>
														<li><a href data-edit="fontSize 3" style="font-size:18px">中</a></li>
														<li><a href data-edit="fontSize 1" style="font-size:14px">小</a></li>
													</ul>
												</div>
												<div class="btn-group">
													<a class="btn btn-default" data-edit="bold" tooltip="粗体 (Ctrl/Cmd+B)"><i class="fa fa-bold"></i></a>
													<a class="btn btn-default" data-edit="italic" tooltip="斜体 (Ctrl/Cmd+I)"><i class="fa fa-italic"></i></a>
													<a class="btn btn-default" data-edit="strikethrough" tooltip="删除线"><i class="fa fa-strikethrough"></i></a>
													<a class="btn btn-default" data-edit="underline" tooltip="下划线 (Ctrl/Cmd+U)"><i class="fa fa-underline"></i></a>
												</div>
												<div class="btn-group">
													<!--<a class="btn btn-default" data-edit="insertunorderedlist" tooltip="项目符号" ><i class="fa fa-list-ul"></i></a>-->
													<a class="btn btn-default" data-edit="insertorderedlist" tooltip="编号"><i class="fa fa-list-ol"></i></a>
													<a class="btn btn-default" data-edit="outdent" tooltip="减少缩进量  (Shift+Tab)"><i class="fa fa-dedent"></i></a>
													<a class="btn btn-default" data-edit="indent" tooltip="缩进 (Tab)"><i class="fa fa-indent"></i></a>
												</div>
												<div class="btn-group">
													<a class="btn btn-default" data-edit="justifyleft" tooltip="左对齐 (Ctrl/Cmd+L)"><i class="fa fa-align-left"></i></a>
													<a class="btn btn-default" data-edit="justifycenter" tooltip="居中 (Ctrl/Cmd+E)"><i class="fa fa-align-center"></i></a>
													<a class="btn btn-default" data-edit="justifyright" tooltip="右对齐 (Ctrl/Cmd+R)"><i class="fa fa-align-right"></i></a>
													<a class="btn btn-default" data-edit="justifyfull" tooltip="两端对齐 (Ctrl/Cmd+J)"><i class="fa fa-align-justify"></i></a>
												</div>
												
												<div class="btn-group">
													<a class="btn btn-default" data-edit="undo" tooltip="撤销 (Ctrl/Cmd+Z)"><i class="fa fa-undo"></i></a>
													<a class="btn btn-default" data-edit="redo" tooltip="重做 (Ctrl/Cmd+Y)"><i class="fa fa-repeat"></i></a>
												</div>
											</div>
											<div ui-jq="wysiwyg" id="content" ng-model="detail.content" name="content" class="form-control insertContent" required style="overflow:scroll;height:200px;max-height:200px"></div>
											
										</td>
									</tr>

									

								</table>

							
								<!-- 添加附件 -->
								<table class="clientInfo-table">
									<tr style="border-bottom:1px solid #eaeff0">
										<td class="client-attachment-left">添加附件</td>
										<td class="client-td-right" style="color:red;padding-top:10px;">（ 可添加Word、Excel、图片、Pdf文件 ）</td>
									</tr>

									<!--<hr style="margin-top:0px; margin-bottom:10px;">-->

									<tr>
										<td class="client-addAttachment-left">附件添加</td>
										<td class="clientInfo-td-right">
											<input id="inquiryAdd_attachmentUploader" class="file-hide" name="attachmentUploader" type="file" file-read style="display:none" uploader="attachmentUploader" multiple />
											<button id="inquiryAdd_attachmentUploaderT" onclick="attachmentUploader.click()" class="btn attachment-select">选择图片</button>


											<button id="inquiryAdd_uploadAll" ng-if="attachmentUploader.queue.length" class="btn tms-btn tms-btn-uploadAll" ng-click="uploadAllFile()" ng-disabled="!attachmentUploader.getNotUploadedItems().length">
												全部上传
											</button>

											<div class="client-attachment-right">
												<div class="wrapper-sm bg-light dk b-b m-b-xs hidden">
													<span class="">上传文件数: <b class="badge bg-info">{{ attachmentUploader.queue.length }}</b></span>
												</div>
												<table class="table-bordered client-table attachment-table" ng-if="attachmentUploader.queue.length">
													<thead>
														<tr>
															<th width="35%">名称</th>
															<th width="12%">大小</th>
															<th width="12%">进度</th>
															<th width="10%">状态</th>
															<th>操作</th>
														</tr>
													</thead>
													<tbody>
														<tr ng-repeat="item in attachmentUploader.queue">
															<td>
																	<strong>{{ item.fileName }}</strong>
															</td>
															<td nowrap>{{ item.fileSize/1024/1024|number:2 }} MB</td>
															<td>
																<div class="progress" style="margin: 0 auto; width:60px;">
																	<div class="progress-bar" role="progressbar" ng-style="{ 'width': item.progress + '%' }"></div>
																</div>
															</td>
															<td class="text-center">
																<span ng-show="item.isSuccess"><i class="text-info glyphicon glyphicon-ok"></i></span>
																<span ng-show="item.isCancel"><i class="glyphicon glyphicon-ban-circle"></i></span>
																<span ng-show="item.isError"><i class="text-danger glyphicon glyphicon-remove"></i></span>
															</td>
															<td nowrap class="attachmentBtns">
																<button id="inquiryAdd_download" class="btn attachment-btn attachment-btn-download" ng-click="handleItemDownLoader(item)" ng-if="item.imgSrc">
																	下载
																</button>
																<!--<button id="inquiryAdd_upload" class="btn tms-btn attachment-btn-upload" ng-click="handleItemUploader(item)" ng-disabled="item.isReady || item.isUploading || item.isSuccess">
																	上传
																</button>-->
																<button id="inquiryAdd_upload" class="btn attachment-btn attachment-btn-upload" ng-click="handleItemUploader(item)" ng-if="!(item.isReady || item.isUploading || item.isSuccess)">
																	上传
																</button>
																<button  id="inquiryAdd_upload" class="btn attachment-btnB attachment-btn-uploadB" ng-click="handleItemUploader(item)" ng-if="item.isReady || item.isUploading || item.isSuccess" disabled>
																	上传
																</button>

																<button id="inquiryAdd_onDelete" class="btn attachment-btn attachment-btn-delete" ng-click="handleItemDelete(item)">
																	删除
																</button>
															</td>
														</tr>
													</tbody>
												</table>										
											</div>

											<div class="clientIfo-bottom">
												<button id="clientInfo_save" type="button" class="btn tms-btn tms-btn-save" ng-click="detail.click()">保存</button>
												<button id="clientInfo_dismiss" type="button" class="btn tms-btn tms-btn-miss" data-dismiss="modal">取消</button>
											</div>


										</td>
									</tr>

								</table>	
							</div>

						</div>
					</div>
				</div>
		</form>
	</div>
	
</div>